Repository navigation
Prepare listing JSON and stage isolated database capacity - #1756
Merged
Merged
Conversation
rdimitrov
marked this pull request as ready for review
October 29, 2026 13:18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cyclic listing bursts hold database connections while application decoding competes with ingress and PostgreSQL for CPU. This change closes listing rows before typed decoding, prepares versioned listing JSON during writes, and adds checkout timing, opt-in loopback profiling and configurable per-replica pools. Derived JSON preserves metadata, invalidates on old-writer updates, falls back for unknown codecs and has a bounded backfill tool.
Production acceptance is still pending. The new placement is running in staging; production has not changed.
Staging capacity and placement
The staging-only profile uses one fixed, tainted e2-standard-4 database node and two–three e2-standard-4 workers: three total idle nodes, four under load. PostgreSQL requests its full 3-CPU limit. App and ingress require worker nodes and retain per-revision hostname spread. Apps scale 3–4 with 800m requests and pools 30/5; ingress scales 3–6 with 800m CPU / 512Mi memory requests. Both CPU targets are 70%, with conservative scale-down. The prepared-listing staging image is digest-pinned. Production enablement of this experimental profile is rejected.
PostgreSQL, three apps and three ingress replicas rolled out successfully. All 48 saved response fixtures matched; the corpus remained 52,366 names / 187,108 versions with zero invalid indexes. One of 84 external health probes failed during rollout, so this was not an interruption-free transition.
At 13:12:29 UTC on October 29, staging naturally consolidated to one DB node and two workers, with all apps and ingress Ready: 2 apps + 1 ingress on one worker, 1 app + 2 ingress on the other. All 20 health probes during idle observation succeeded. No forced eviction or resize was used. This proves idle placement/consolidation, not loaded burst recovery. System agents still share the DB node; PostgreSQL remains a singleton. Node-upgrade surge can temporarily exceed four nodes. Public networking was not changed.
Staging deployment transition
The database pool and app HPA already exist from the staging experiment. Before the normal staging apply, GitHub Actions will use its existing staging passphrase secret to import these exact resources into Pulumi. The adoption script skips completed imports, checks stack/provider/resource identities and rejects conflicting ownership. The DB pool is protected from deletion. Staging apply refreshes state before planning.
Local adoption was blocked by the unavailable stack passphrase. The script's plan was checked against the exported staging state, but the CI import/apply has not yet executed. The pinned staging image deliberately preserves the tested candidate until acceptance; remove that override when returning to normal staging builds.
Existing performance evidence and limits
The same ordered 274,116-read production trace was compared across baseline, app only, and the earlier shared-node infrastructure candidate. App-only sampled CPU fell approximately 31% (2.13 to 1.47 cores). Generator drops fell from 2.10% to 0.84%; attempted page p95 fell from 3,322 to 1,597 ms. The older infrastructure arm dropped 0.70% and had seven transport failures. All arms failed the short delivery gate.
Drops were confined to the initial 84 seconds of an abrupt replay into empty ingress caches. Twelve final-minute cache/body-size/key-diversity/query-mix checks passed, but this does not qualify the startup cache state or full production cycle. Detail 404s from the older staging corpus and single-source rate-limit 429s must be resolved in the next comparison.
Earlier recovery completed 180,000/180,000 reads, but that was a different two-replica/shared-node candidate. Its result is not credited to this placement. The ten-minute peak and publish workload have not yet been tested with the new layout.
Validation and promotion gate
See isolated placement and evidence, production trace comparison, workload audit and capacity candidate.